Skip to main content

Adding variables and data manipulation

Adding variables and performing data manipulation in AutomatR Studio is essential for managing and processing data within your automation workflows. Here's a brief overview of how to add variables and manipulate data:

Create Variables

  • To add variables, go to the Variables panel, typically located at the bottom of the UI in AutomatR Studio.

    • Right-click on the activity and select Create Variable.

    • Provide a name for the variable in the Variables panel, specify its variable type (e.g., String, Int32, Boolean), and set a default value if necessary.

Assign Values to Variables

  • You can assign values to variables using the Assign activity or directly within the properties of activities that support output variables.

    • For example, to assign a value to a String variable, use the Assign activity and set the variable's value to a specific text or the result of an expression.

Retrieve and Manipulate Data

  • Variables can store data obtained from various sources, such as user input, file reading, or web scraping.

    • Use activities and expressions to retrieve and manipulate data. For instance, you can extract text from a web page and store it in a variable, then manipulate that text using string manipulation functions.
  • Data Type Conversion: Convert data between different data types using type conversion functions. For example, you can convert a String variable to an Integer for mathematical calculations.

  • Perform Arithmetic Operations: Use variables to perform mathematical operations such as addition, subtraction, multiplication, and division. Store the results in variables for further use.

  • String Manipulation: When dealing with text data, use String methods to manipulate strings. Common operations include concatenation, splitting, replacing, and formatting strings.

  • Array and List Operations: Variables can also hold arrays or lists of data. You can manipulate these collections by adding or removing items, sorting, filtering, or iterating through their elements.

  • Date and Time Manipulation: Use variables to work with date and time values. You can add or subtract time intervals, format dates, and compare date and time values.

  • Conditional Logic: Variables are often used in conjunction with conditional statements (e.g., If activities) to make decisions and control the flow of your workflow based on data values.

  • Debugging and Logging: During debugging, use the Output panel to display variable values and track the data as it flows through your workflow. This helps identify issues and verify data correctness.

  • Exception Handling: When handling exceptions, you can use variables to capture error messages or details for logging or further processing.

  • Variable Scopes: Pay attention to variable scope. Variables can be defined at different levels, including global, workflow, and local scopes, affecting their visibility and lifespan within your automation.

Adding variables and manipulating data in AutomatR Studio enables you to work with data effectively, automate data-driven tasks, and create dynamic and flexible automation workflows. It's a crucial skill for building robust and versatile automation solutions.